home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.40 / xsc / tasch.p next >
Text File  |  1994-12-10  |  2KB  |  86 lines

  1. PROGRAM daschenreschner;
  2.  
  3. USES xsc;
  4.  
  5. VAR mem,operand,operand2:real;
  6.     operation:CHAR;
  7.  
  8.  
  9. BEGIN
  10.  writeln(' Hallo ich bin Dein Dich liebender Daschenreschner!');
  11.  writeln('Sprech doch mal mit mir !');
  12.  write('Bitte Operand eingeben: ');read(operand);
  13.  operation:=' ';
  14.  mem:=0;
  15.  WHILE (operation<>'Q') DO BEGIN
  16.   writeln('Ergebnis: ',operand);
  17.   read(Operation);
  18.   Operation:=upcase(operation);
  19.   CASE operation OF
  20.    'E':BEGIN
  21.        operand:= exp(operand);
  22.        read(operation);
  23.        END;
  24.    'L':BEGIN
  25.        operand:= ln(operand);
  26.        read(operation);
  27.        END;
  28.    'C':BEGIN
  29.        operand:= cos(operand);
  30.        read(operation);
  31.        END;
  32.    'S':BEGIN
  33.        operand:= sin(operand);
  34.        read(operation);
  35.        END;
  36.    'T':BEGIN
  37.        operand:= tan(operand);
  38.        read(operation);
  39.        END;
  40.    'W':BEGIN
  41.        operand:= sqrt(operand);
  42.        read(operation);
  43.        END;
  44.    'M':BEGIN
  45.        mem:=operand;
  46.        read(operation);
  47.        END;
  48.    'R':BEGIN
  49.        operand:=mem;
  50.        read(operation);
  51.        END;
  52.    'Z': BEGIN
  53.          operand:=0;
  54.          writeln('Dajn Oparant ißt jedsd nuhl');
  55.          read(operation);
  56.         END;
  57.    'H': BEGIN
  58.          readln(operation);
  59.          operation:=upcase(operation);
  60.          CASE operation OF
  61.           'C':operand:= cosh(operand);
  62.           'S':operand:= sinh(operand);
  63.           'T':operand:= tanh(operand)
  64.          ELSE writeln('Du Trottel') END;
  65.         END;
  66.    '+': BEGIN
  67.          read(operand2);
  68.          operand:=operand+operand2;
  69.         END;
  70.    '-': BEGIN
  71.          read(operand2);
  72.          operand:=operand-operand2;
  73.         END;
  74.    '*': BEGIN
  75.          read(operand2);
  76.          operand:=operand*operand2;
  77.         END;
  78.    '/': BEGIN
  79.          read(operand2);
  80.          operand:=operand/operand2;
  81.         END
  82.   ELSE END;
  83.  END;
  84.  writeln('Auf Wiedersehn, es war so schöhn');
  85. END.
  86.